define(function(require){
//	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	var ideService = require("$UI/system/designer/webIde/common/IDEService");
	var xCloudService = ideService.getXCloudService();
	
	var Model = function(){
		this.callParent();
	};


	Model.prototype.okBtnClick = function(event){
		var  path = "main/jianjiedz";
		var tababeName = path.substring(path.lastIndexOf("/")+1,path.length);
		var main = path.substring(0,path.lastIndexOf("/"));
		var filePath ="service/"+main+"/init/"+tababeName+".json";
		var row = this.comp("demoData").getCurrentRow();
		var json =  this.params.data;
		var newJson = row.toJson({"format":"simple"});
		delete newJson.userdata;
		newJson.fid = justep.UUID.createUUID();
		if(!json)json=[];		
		json.push(newJson);
		xCloudService.saveFile({filePath:filePath,content:JSON.stringify(json)});
		this.owner.send({});
		this.close();
	};


	return Model;
});